#!/usr/bin/env python3

# -*- coding: utf-8 -*-

# @author: zhangbo

# @time: 2025/4/18 10:16

from utils.read_yaml import Read_yaml
from utils.tools import get_project_name, sep


class LcdOrDisplayFailureBase:

    def __init__(self, yaml_path):
        # 获取yaml配置
        self.login_config = Read_yaml(yaml_path).get_config_data("Lcd_Or_DisplayFailure_config")

    def alarm_center(self):
        """
        报警中心
        :return:
        """
        return self.login_config["Lcd_Or_DisplayFailure_config"]["alarmCenter"]

    def alarm_rules(self):
        """
        报警规则
        :return:
        """
        return self.login_config["Lcd_Or_DisplayFailure_config"]["alarmRules"]

    def base_Alarm_Rules(self):
        """
        基础报警
        :return:
        """
        return self.login_config["Lcd_Or_DisplayFailure_config"]["baseAlarmRules"]

    def input_is_selected(self):
        """
        LCD或者显示屏故障 input框
        :return:
        """
        return self.login_config["Lcd_Or_DisplayFailure_config"]["input_is_selected"]

    def input_span(self):
        """
        LCD或者显示屏故障  span值
        :return:
        """
        return self.login_config["Lcd_Or_DisplayFailure_config"]["input_span"]

    def get_simulator_conf_parameters(self):
        """
        获取模拟器 simulator_conf 配置文件参数
        :return:
        """

        # 获取phone
        phone = self.login_config["dev"]["phone"]
        terminalNum = self.login_config["dev"]["terminalNum"]
        serverIP = self.login_config["env"]["serverIP"]
        serverPort = self.login_config["env"]["serverPort"]
        fullGps = self.login_config["env"]["fullGps"]
        conf_path = self.login_config["filepath"]["conf_path"]
        gps_info = self.login_config["filepath"]["gps_info"]

        return phone, terminalNum, serverIP, serverPort, fullGps, conf_path, gps_info

    def get_exe_path(self):
        """
        获取exe_path 路径地址
        :return:
        """

        return self.login_config["filepath"]["exe_path"]

    def get_alarm_center(self):
        """
        报警台账
        :return:
        """
        return self.login_config["Lcd_Or_DisplayFailure_config"]["alarmLedger"]

    def get_alarm_ledger_clear_button(self):
        """
        报警条件清除
        :return:
        """
        return self.login_config["Lcd_Or_DisplayFailure_config"]["alarmLedgerClearButton"]

    def get_alarm_type(self):
        """
        选择报警类型
        :return:
        """
        return self.login_config["Lcd_Or_DisplayFailure_config"]["alarmType"]

    def get_choose_over_thermal(self):
        """
        选择超温告警
        :return:
        """
        return self.login_config["Lcd_Or_DisplayFailure_config"]["alarmTypeNoEntry"]

    def get_car_num_input(self):
        """
        点击车牌号控件
        :return:
        """
        return self.login_config["Lcd_Or_DisplayFailure_config"]["car_num_input"], \
            self.login_config["Lcd_Or_DisplayFailure_config"][
                "car_num"]

    def car_id(self):
        """
        车牌号
        :return:
        """
        return self.login_config["dev"]["car_id"]

    def get_start_end_time(self):
        """
        报警开始结束时间
        :return:
        """
        return self.login_config["Lcd_Or_DisplayFailure_config"]["start_input_time"], \
            self.login_config["Lcd_Or_DisplayFailure_config"][
                "end_input_time"]

    def query_button(self):
        """
        查询按钮
        :return:
        """
        return self.login_config["Lcd_Or_DisplayFailure_config"]["query_button"]

    def result_element_tr(self):
        """
        报警上报条件
        :return:
        """
        return self.login_config["Lcd_Or_DisplayFailure_config"]["alarm_result"]
